package com.woniu.schedule;

import com.woniu.service.elasticSearch.ElasticsearchForTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduledTask {
    @Autowired
    ElasticsearchForTest elasticsearchForTest;
    @Scheduled(fixedRate = 1000*60*60*24)
    public void run() {
        elasticsearchForTest.deleteData();
        elasticsearchForTest.autoLoadAllData();
        System.out.println("定时任务执行了");
    }
}
